#include<iostream>
#include<string>

using namespace std;

class Solution {
public:
    bool isPalindrome(string s) {
        if (s.size() == 0)
        {
            return true;
        }
        int i = 0;
        while (i < s.size())
        {
            if (islower(s[i]) || isdigit(s[i]))
            {
                i++;
                continue;
            }
            if (isupper(s[i]))
            {
                s[i] = tolower(s[i]);
                i++;
                continue;
            }
            s.erase(s.begin() + i);
        }
        int h = 0;
        int tra = s.size() - 1;
        while (h <= tra)
        {
            if (s[h] != s[tra])
            {
                return false;
            }
            else
            {
                h++;
                tra--;
            }
        }
        return true;
    }
};

int main()
{
    Solution s;
    s.isPalindrome("0P");
    return 0;
}